Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Fully Qualified Name for Fixed avro type #179

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

lukasleung
Copy link
Contributor

Background

This is similar to the enum issue (#169) however affects the avro Fixed type.

What has Changed

  • update GoType() for the FieldDefinition to use String() which will format properly instead of Name
  • adds unit tests specifically for the Fully Qualified Name.

Sample Test Failure with current version of gogen-avro:

--- FAIL: TestRoundTrip (0.00s)
    util.go:109:
        	Error Trace:	util.go:109
        	            				schema_test.go:12
        	Error:      	Not equal:
        	            	expected: []byte{0x0, 0x0, 0xff, 0xff}
        	            	actual  : []byte{0x0, 0xff, 0xff}

        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,3 +1,3 @@
        	            	-([]uint8) (len=4) {
        	            	- 00000000  00 00 ff ff                                       |....|
        	            	+([]uint8) (len=3) {
        	            	+ 00000000  00 ff ff                                          |...|
        	            	 }
        	Test:       	TestRoundTrip
    util.go:120:
        	Error Trace:	util.go:120
        	            				schema_test.go:12
        	Error:      	Received unexpected error:
        	            	cannot decode textual record "ConflictingNamespaceFixedTestRecord": cannot decode textual fixed "com.company.team.ConflictingFixedType": datum size ought to equal schema size: 2 != 1 for key: "fixedFieldOne"
        	Test:       	TestRoundTrip

@actgardner
Copy link
Owner

Thanks @lukasleung! LGTM :)

@actgardner actgardner merged commit 77e7e07 into actgardner:master Feb 7, 2022
@lukasleung lukasleung deleted the feature/fqdn-field-type branch February 7, 2022 22:42
@lukasleung
Copy link
Contributor Author

Thanks @actgardner!

Do you have a rough idea of when you would be able to cut tags for this change? 😄

@actgardner
Copy link
Owner

@lukasleung I just cut 10.2.0 with this fix :)

@lukasleung
Copy link
Contributor Author

Much appreciated thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants